package com.boot.sample.jdbc;

import com.boot.sample.jdbc.domain.AccessLog;
import com.boot.sample.jdbc.service.AccessLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
public class BootApplication {
    @Autowired
    private AccessLogService accessLogService;
    public static void main(String[] args) {
        SpringApplication.run(BootApplication.class, args);
    }


    @RequestMapping("/")
    String index() {

        AccessLog accessLog = accessLogService.queryById(202407l);
        return accessLog.getDescription();
    }
}
